package com.it.base.arithmetic.base.dm.observer;

public class Test {
    public static void main(String[] args) {
        //主题
        Subject subject = new ConcreteSubject();
        //两个观察者
        Observer observer01 = new Observice01();
        Observer observer02 = new Observice02();
        //把两个观察者注册到主题中
        subject.register(observer01);
        subject.register(observer02);
        //当主题有变化的时候通知所有注册到主题的观察者
        subject.notifyObserver();
    }
}
